from signal import pause

from gpiozero import LED, Button

from library import respberrypi

if __name__ == '__main__':
    BUTTON_DATA_PIN = 4
    LED_DATA_PIN = 6
    respberrypi.gpio_init()
    led = LED(LED_DATA_PIN, initial_value=False)
    button = Button(BUTTON_DATA_PIN, hold_time=2)
    button.when_pressed = led.on
    button.when_released = led.off
    button.when_held = led.blink
    pause()
